<template>
  <div class="header">
    <span class="photo"></span>
    <div class="system-name">
      大学生就业能力评价和职位推荐系统后台
    </div>
    <el-dropdown>
    <span class="el-dropdown-link">
      {{ user.value }}
      <el-icon class="el-icon--right">
        <arrow-down />
      </el-icon>
    </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click="leave">退出系统</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { ElMessageBox } from "element-plus";
import router from "../../router/router";

const user = ref();
user.value = 'xxx';
onMounted(() => {

})

// 离开系统
const leave = () => {
  ElMessageBox.confirm(
      '您确定要离开嘛？',
      '危险操作',
      {confirmButtonText:'确定',cancelButtonText:'取消',type:'warning',}
  ).then(() => {
    router.push('/adminLogin');
  })
}
</script>

<style scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  border-bottom: 1px solid #dcdfe6;
}
.system-name {
  font-size: 20px;
  font-weight: bold;
  margin-left: 40px;
}
.el-dropdown-link {
  cursor: pointer;
  display: inline-block;
  padding: 0 20px;
  height: 100%;
  line-height: 60px;
  color: #000000;
  align-items: center;
  border: none !important;
  outline: none;
  box-shadow: none;
}
.photo {
  width: 30px;
  height: 30px;
  background-image: url(../../assets/images/icons/招聘.png);
  position: absolute;
}
</style>